#include<stdio.h>

int sum(int grade[], int n);

float average(int grade[], int n);

int main()
{
    int m, n;
    int data[100][100];
    scanf("%d %d", &m, &n);

    for(int i = 0; i < m; i ++)
    {
        for(int j = 0; j < n; j ++)
        {
            scanf("%d", &data[i][j]);
        }
        printf("%d %.1f\n", sum(data[i], n), average(data[i], n));
    }

    return 0;
}

int sum(int grade[], int n)
{
    int *p = grade;
    int sum = 0;
    for(int i = 0; i < n; i ++)
    {
        sum += *(p + i);
    }

    return sum;
}

float average(int grade[], int n)
{
    float sum = 0;
    int *p = grade;
    for(int i = 0; i < n; i ++)
    {
        sum += *(p + i);
    }

    return (sum / n);
}
